package com.newlink.building.login.mvp.presenter

import com.newlink.building.login.mvp.contract.Module_Login_InputVerifyCodeContract
import com.newlink.building.login.mvp.model.Module_Login_InputVerifyCodeModel
import com.newlink.building.common_base.base.BasePresenter
import com.newlink.building.common_base.ext.ss

/**
 * @Author: Jake
 * @Date: 2023-04-06
 * @Description:
 */
class Module_Login_InputVerifyCodePresenter :
    BasePresenter<Module_Login_InputVerifyCodeContract.Model, Module_Login_InputVerifyCodeContract.View>(),
    Module_Login_InputVerifyCodeContract.Presenter {

    override fun createModel(): Module_Login_InputVerifyCodeContract.Model = Module_Login_InputVerifyCodeModel()

    override fun sendVerifyCode(code: String, email: String) {
        mModel?.sendVerifyCode(code, email)?.ss(mModel, mView) {
            if (it?.data == true) {
                mView?.sendVCSuccess()
            } else {
                mView?.sendVCFailed()
            }
        }
    }
}